home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-coverdisks-
/
115a
/
ppt
/
rexx
/
askreq.prx
< prev
next >
Wrap
Text File
|
1998-07-29
|
2KB
|
118 lines
/*
This is a sample script for PPT that shows the power of
the ASKREQ rexx command. It will create one instance of
each of the types that the ASKREQ command recognizes.
$Id: AskReq.prx 1.2 1998/06/29 20:51:21 jj Exp jj $
*/
/*-------------------------------------------------------------------*/
/* I suggest you use this header as-is and add your own code below */
OPTIONS RESULTS
SIGNAL ON ERROR
IF ADDRESS() = REXX THEN DO
startedfromcli = 1
ADDRESS PPT
END
ELSE DO
startedfromcli = 0
ADDRESS PPT
END
RESULT = 'no result'
/*-------------------------------------------------------------------*/
/* Add your code here */
/*
Create a slider gadget
*/
SB.TYPE=SLIDER
SB.LABEL="Slide me"
SB.MIN=-50
SB.MAX=50
SB.DEFAULT=0
/*
Create a checkbox gadget
*/
CB.TYPE=CHECKBOX
CB.LABEL="Check me"
CB.SELECTED=0
/*
Create a cycle gadget
*/
CYC.TYPE=CYCLE
CYC.LABEL="Choose one"
CYC.LABELS="Zero|One|Two|Three|Four"
CYC.POPUP=1
/*
Create a string gadget
*/
STR.TYPE=string
STR.INITIALSTRING="Foobar"
STR.MAXCHARS=10
STR.LABEL="Edit me"
/*
Create a float gadget
*/
FLO.TYPE=float
FLO.MIN=-10.0
FLO.MAX=10.0
FLO.DEFAULT=0.0
FLO.FORMATSTRING='%.1f'
/*
Make sure PPT is in the front and show the request
*/
PPT_TO_FRONT
ASKREQ '"My title"' CB SB CYC STR FLO
res = RESULT
/*
Show the results.
*/
IF res = 0 THEN DO
IF startedfromcli = 1 THEN DO
PPT_TO_BACK
SAY "User accepted"
SAY 'SLIDER = 'SB.VALUE
SAY 'CHECKBOX = 'CB.VALUE
SAY 'CYCLE = 'CYC.VALUE
SAY 'STRING = 'STR.VALUE
SAY 'FLOAT = 'FLO.VALUE
END
ELSE DO
ASKREQ '"SLIDER='SB.VALUE' CHECKBOX='CB.VALUE' CYCLE='CYC.VALUE' STRING='STR.VALUE' FLOAT='FLO.VALUE'"' NEGATIVE '""'
END
END
ELSE DO
SAY "User cancelled"
END
EXIT 0
/*-------------------------------------------------------------------*/
/* Again, keep this part intact. This is the error handler. */
ERROR :
returncode = RC
IF startedfromcli = 1 THEN DO
SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
PPT_TO_BACK
END
ELSE
SHOWERROR '"'RC2'"' SIGL
EXIT returncode